<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>选择器权重</title>
		<!-- 选择器权重越高，选中几率越大 -->
		<style>
			*{  /*权值 0  很容易被覆盖*/
				color: #302ca2;
				background: #00aaff;
			}
			div{  /*权值 1*/
				color: #007e00;
				background: #00ff00;
			}
			.d1{  /*权值 10*/
				color: #930000;
				background: #ff0000;
			}
			div.d1{  /*选择器权值之和 11*/
				color: #db5e1f;
				background: #ffaa00;
			}
			body div.d1{  /*权值 12*/
				font-size: 25px;
			}
			#d1{  /*权值 100*/
				font-size: 15px;
				color: #baba00;
				background: #ffff7f;
			}
			div#d1{  /*权值 101*/
				font-size: 20px;
				color: #600090;
				background: #aaaaff;
			}
			div#d1:hover{  /*权值 111*/
				color: #ae0057;
				background: #fc8cff;
			}
		</style>
	</head>
	<body>
		<div class="d1" id="d1" style="color: red;">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias repellat libero inventore minima deleniti ut. Obcaecati, odio! Natus eius eos esse molestiae minus, nam aliquam fugit dolores! Deserunt, eos magni?</div>
	</body>
</html>